#include <stdio.h>

int main() {
    int result = 0;
    // 双指针
    int indexL = 1;
    int indexR = 1;
    int currSum = 1;
    int target;
    scanf("%d", &target);
    while (indexR <= target) {
        if (currSum < target) {
            indexR++;
            currSum += indexR;
        }
        else if (currSum > target) {
            currSum -= indexL;
            indexL++;
        }
        else {
            result++;
            indexR++;
            currSum += indexR;
        }
    }
    printf("%d", result);
    return 0;
}